<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Order extends Model
{
//    use SoftDeletes;
    protected $table = 'orders';
    protected $fillable = [
        'user_id', 'goods_id', 'price'
    ];

    /**
     * 用户竞拍过的商品
     * @param $user_id
     * @return mixed
     */
    static public function myOrder($user_id)
    {
        $re = self::where(['user_id' => $user_id])->pluck('goods_id')->toArray();

        return $re;
    }

}
